#include "RabbitMqPro.h"

static string host = "127.0.0.1";    
static int port = 5672;    
static string username = "guest";
static string password = "guest";
static string vhost = "/";


RabbitMqPro::RabbitMqPro()
:_channel(AmqpClient::Channel::Create(host, port, username, password, vhost))
{}

void RabbitMqPro::sendMessage(string & filename){
    AmqpClient::BasicMessage::ptr_t message = AmqpClient::BasicMessage::Create(filename);
    // 发布消息
    string exchange = "my.direct";
    string routingKey = "key1";
    _channel->BasicPublish(exchange, routingKey, message);

}
